<?php
error_reporting(0);
if(!($dp = opendir("temp/"))) die ("Cannot open maker/");
$file_array = array();
while ($file = readdir ($dp)){if(substr($file,0,1) != '.' and $file != "index.php"){$file_array[] =  $file;}}
$file_count = count ($file_array);
sort ($file_array);
if ($file_count > 0)
{

while (list($fileIndexValue, $file_name) = each ($file_array))
{
$file_name="temp/$file_name";
$lenght=strlen($file_name);
$mtime=filemtime($file_name);
$now=time();



if(($now-$mtime) > 120)
{
	unlink($file_name);
}


}

}

closedir($dp);
?>
